home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / UTILITY1 / MSWLGO35.ZIP / EXAMPLES / MODAL.WIN < prev    next >
Text File  |  1993-08-23  |  4KB  |  144 lines

  1. ;
  2. ; Function:
  3. ;
  4. ; This function is shows all the controls available to MswLogo.
  5. ; It runs in "MODAL" mode. That is, the parent window and the caller
  6. ; cannot proceed until this window is closed.
  7. ;
  8. ; To run:
  9. ;
  10. ; Load "modal.win
  11. ; Call MODAL
  12. ;
  13. to modal
  14. make "cmw 75
  15. make "cmh 30
  16. make "sth 12
  17. make "lsw :cmw
  18. make "lsh 20
  19. make "scw 10
  20. make "sch 40
  21. make "btw 50
  22. make "bth 12
  23. make "gapx 6
  24. make "gapy 6
  25. make "mary 2
  26. make "wnx 180
  27. make "wny 120
  28. make "wnx2 :wnx / 2
  29. make "wny2 :wny / 2
  30. make "wnx3 :wnx / 3
  31. make "wny3 :wny / 3
  32. make "wnx6 :wnx / 6
  33. make "wny6 :wny / 6
  34. make "st2w 30
  35. make "row2 :wny3+:gapy
  36. make "row3 :wny3*2-:gapy/2
  37.  
  38. dialogcreate "main "d1 [This is a Demo Windows Application] 0 0 :wnx+:gapy :wny+:gapy [setup]
  39. end
  40.  
  41. to drawthing
  42. setpencolor (list scrollbarget "s1 scrollbarget "s2 scrollbarget "s3)
  43. repeat scrollbarget "s4~
  44.   [~
  45.   run comboboxgettext "c1~
  46.   if equalp [HEXAGON] listboxgetselect "l1 [repeat 6 [fd 100 rt 60]]~
  47.   if equalp [SQUARE] listboxgetselect "l1 [repeat 4 [fd 100 rt 90]]~
  48.   if equalp [TRIANGLE] listboxgetselect "l1 [repeat 3 [fd 100 rt 120]]~
  49.   run comboboxgettext "c2~
  50.   ]
  51. end
  52.  
  53. to myblue
  54. staticupdate "st13 sentence [Blue] scrollbarget "s3
  55. end
  56.  
  57. to myend
  58. dialogdelete "d1
  59. end
  60.  
  61. to mygreen
  62. staticupdate "st12 sentence [Grn] scrollbarget "s2
  63. end
  64.  
  65. to mynil
  66. end
  67.  
  68. to myred
  69. staticupdate "st11 sentence [Red] scrollbarget "s1 
  70. end
  71.  
  72. to myrepeat
  73. staticupdate "st14 sentence [Repeat Count] scrollbarget "s4 
  74. end
  75.  
  76. to mystatic
  77. staticupdate "st14 sentence [Repeat Count] scrollbarget "s4 
  78. end
  79.  
  80. to setup
  81. staticcreate "d1 "st2 [Select Pre-Command] :gapx :mary :cmw :sth
  82. comboboxcreate "d1 "c1 :gapx :sth+:mary :cmw :cmh
  83. comboboxaddstring "c1 [PU FD 50 PD]
  84. comboboxaddstring "c1 [PU FD 100 PD]
  85. comboboxaddstring "c1 [PU FD REPCOUNT PD]
  86.  
  87. staticcreate "d1 "st3 [Select Post-Command] :wnx2+:gapx :mary :cmw :sth
  88. comboboxcreate "d1 "c2 :wnx2+:gapx :sth+:mary :cmw :cmh
  89. comboboxaddstring "c2 [PU BK 50 PD RT 2]
  90. comboboxaddstring "c2 [PU BK 100 PD RT 5]
  91. comboboxaddstring "c2 [PU BK REPCOUNT PD RT 5]
  92. comboboxsettext "c2 [RT 5]
  93.  
  94. staticcreate "d1 "st4 [Select Shape] :gapx :row2 :lsw :sth
  95. listboxcreate "d1 "l1 :gapx :row2+:sth+1 :lsw :lsh
  96. listboxaddstring "l1 "SQUARE
  97. listboxaddstring "l1 "TRIANGLE
  98. listboxaddstring "l1 "HEXAGON
  99.  
  100. staticcreate "d1 "st11 "Red :wnx6*3+:gapx :row2 :st2w :sth
  101. scrollbarcreate "d1 "s1 :wnx6*3+:gapx :row2+:sth :scw :sch [myred]
  102. scrollbarset "s1 1 255 125 myred
  103.  
  104. staticcreate "d1 "st12 "Grn :wnx6*4+:gapx :row2 :st2w :sth
  105. scrollbarcreate "d1 "s2 :wnx6*4+:gapx :row2+:sth :scw :sch [mygreen]
  106. scrollbarset "s2 1 255 125 mygreen
  107.  
  108. staticcreate "d1 "st13 "Blue :wnx6*5+:gapx :row2 :st2w :sth
  109. scrollbarcreate "d1 "s3 :wnx6*5+:gapx :row2+:sth :scw :sch [myblue]
  110. scrollbarset "s3 1 255 125 myblue
  111.  
  112. staticcreate "d1 "st14 [Repeat Count] :gapx :row3 :sch*2 :sth
  113. scrollbarcreate "d1 "s4 :gapx :row3+:sth :sch*2 :scw [myrepeat]
  114. scrollbarset "s4 1 360 72 myrepeat
  115.  
  116. buttoncreate "d1 "b1 "END :gapx :wny-:bth-:gapy :btw :bth [myend]
  117. buttoncreate "d1 "b3 "CLEAR :wnx2-:btw/2 :wny-:bth-:gapy :btw :bth [cs]
  118. buttoncreate "d1 "b2 "DRAW :wnx-:btw-:gapx :wny-:bth-:gapy :btw :bth [drawthing]
  119. end
  120.  
  121. Make "bth 12
  122. Make "btw 50
  123. Make "cmh 30
  124. Make "cmw 75
  125. Make "gapx 6
  126. Make "gapy 6
  127. Make "lsh 20
  128. Make "lsw 75
  129. Make "mary 2
  130. Make "row2 46
  131. Make "row3 77
  132. Make "sch 40
  133. Make "scw 10
  134. Make "st2w 30
  135. Make "sth 12
  136. Make "wnx 180
  137. Make "wnx2 90
  138. Make "wnx3 60
  139. Make "wnx6 30
  140. Make "wny 120
  141. Make "wny2 60
  142. Make "wny3 40
  143. Make "wny6 20
  144.